<?php
/**
 * Template: Navigation.php 
 *
 * @package WP_Framework
 * @subpackage Default_Template
 */

$maxpage = intval( $wp_query->max_num_pages );
$page = intval( $paged );
$next = get_adjacent_post( false, '', false);
$prev = get_adjacent_post( false, '');

if ( is_singular() ) { ?>
<!--BEGIN .navigation-links-->
<div class="navigation-links single-page-navigation">
	<?php if ( $prev ) { ?>
	<div class="nav-previous"><?php previous_post_link( '&laquo; <span class="nav-meta">%link</span>' ); ?></div>
	<?php } if ( $next ) { ?>
	<div class="nav-next"><?php next_post_link('%link <span class="nav-meta">&raquo;</span>'); ?></div>
	<?php } ?>
<!--END .navigation-links-->
</div>
<?php } elseif ( $maxpage > 1 ) { ?>
<!--BEGIN .navigation-links-->
<div class="navigation-links page-navigation">
	<?php if ( $page < $maxpage ) { // go back in time ?>
	<span class="nav-next"><?php next_posts_link( '<span class="nav-meta">&laquo;</span> Older Entries' ); ?></span>
	<?php } if ( $page > 1 ) { // go to the front page ?>
	<span class="nav-previous"><?php previous_posts_link( 'Newer Entries <span class="nav-meta">&raquo;</span>' ); ?></span>
	<?php } ?>
<!--END .navigation-links-->
</div>
<?php }